#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=1000000007;
ll f[100001];
int main() {
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	ll x,y;
	cin>>x>>y;
	f[x]=1;
	for(int i=1;i<=y;i++) {
		if(i*2<=y)
			f[i*2]=(f[i*2]+f[i])%mod;
		if(i+1<=y)
			f[i+1]=(f[i+1]+f[i])%mod;
	}
	cout<<f[y];
	return 0;
}
